package ai.esc.speedy.common.constant;

import ai.esc.speedy.admin.user.api.DynamicEncryptionCodeQuery;

/**
 * @author SAGE
 * @version v1 2019/4/3 19:38
 */
public interface CommonConstants extends SageConstants {

    /**
     * 默认OK值
     */
    Integer SU_DEFAULT_OK_CODE = 20000;
    // ###############################################

    /**
     * 默认异常值
     */
    Integer EX_DEFAULT_ERROR_CODE = 50000;
    // ###############################################

    /**
     * 标准异常值
     */
    Integer EX_STANDARD_CODE = 500;
    // ###############################################

    /**
     * 用户token异常
     */
    Integer EX_USER_INVALID_CODE = 40101;
    Integer EX_USER_PASS_INVALID_CODE = 40001;
    Integer EX_TOKEN_ERROR_CODE = 40101;
    // ###############################################

    /**
     * 组织架构异常
     */
    Integer EX_ORG_ELEMENT_ERROR_CODE = 51000;

    /**
     * 匿名用户标识
     */
    String USER_ANONYMOUS = "anonymous";
    Integer USER_ANONYMOUS_CODE = 51001;

    /**
     * 没有访问权限
     */
    Integer EX_NO_ACCESS_CODE = 51003;
    // ###############################################

    /**
     * 客户端token异常
     */
    Integer EX_CLIENT_INVALID_CODE = 40301;
    Integer EX_CLIENT_FORBIDDEN_CODE = 40331;
    // ###############################################

    String RESOURCE_TYPE_MENU = "menu";
    String RESOURCE_TYPE_BTN = "button";
    // ###############################################

    String CONTEXT_KEY_PERSON_OBJECT = "person";
    String CONTEXT_KEY_USER_OBJECT = "currentLoggedUser";
    String CONTEXT_KEY_USER_ID = "currentUserId";
    String CONTEXT_KEY_USERNAME = "currentUserName";
    String CONTEXT_KEY_USER_NAME = "currentUser";
    String CONTEXT_KEY_USER_TOKEN = "currentUserToken";
    String JWT_KEY_USER_ID = "userId";
    String JWT_KEY_NAME = "name";
    // ###############################################

    /**
     * Java CLASS_TYPE_NAMES
     */
    String[] CLASS_TYPE_NAMES = {
            "java.lang.Boolean", "java.lang.Character", "java.lang.Float",
            "java.lang.Double", "java.lang.Byte", "java.lang.Short",
            "java.lang.Integer", "java.lang.Long", "java.lang.Void",
    };

    String CLASS_TYPE_BOOLEAN = CLASS_TYPE_NAMES[0];
    String CLASS_TYPE_CHARACTER = CLASS_TYPE_NAMES[1];
    String CLASS_TYPE_FLOAT = CLASS_TYPE_NAMES[2];
    String CLASS_TYPE_DOUBLE = CLASS_TYPE_NAMES[3];
    String CLASS_TYPE_BYTE = CLASS_TYPE_NAMES[4];
    String CLASS_TYPE_SHORT = CLASS_TYPE_NAMES[5];
    String CLASS_TYPE_INTEGER = CLASS_TYPE_NAMES[6];
    String CLASS_TYPE_LONG = CLASS_TYPE_NAMES[7];
    String CLASS_TYPE_VOID = CLASS_TYPE_NAMES[8];
    String CLASS_TYPE_STRING = "java.lang.String";
    String CLASS_TYPE_JAVA_UTIL_DATE = "java.util.Date";
    // ###############################################

    // redis key
    String REDIS_SMS_VCODE_KEY = "APP:SMS:V:CODE:";
    String REDIS_EMAIL_VCODE_KEY = "APP:EMAIL:V:CODE:";
    String REDIS_DYNAMIC_ENCRYPTION_CODE_KEY = "APP:DYNAMIC:ENCRYPTION:CODE:";
    String REDIS_REFRESH_TOKEN_KEY = "APP:USER:TOKEN:REFRESH:";
}
